package com.sz.common.base.message;

/**
 * Function: TODO: ADD FUNCTION <br>
 * Author: Charles. <br>
 * Date: 2017-05-20 16:08:00.
 */
public class MessageCode {
    protected Integer code;
    protected String messageKey;
    protected String defaultArgument;

    /**
     * @param code
     * @param messageKey
     */
    public MessageCode(Integer code, String messageKey) {
        this(code, messageKey, null);
    }

    /**
     * @param code
     * @param messageKey
     * @param defaultArgument
     */
    public MessageCode(Integer code, String messageKey, String defaultArgument) {
        this.code = code;
        this.messageKey = messageKey;
        this.defaultArgument = defaultArgument;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessageKey() {
        return messageKey;
    }

    /**
     * @return
     */
    public String[] getDefaultArguments() {
        return (defaultArgument == null || defaultArgument.length() == 0)
                ? null : new String[]{defaultArgument};
    }

    public void setMessageKey(String messageKey) {
        this.messageKey = messageKey;
    }
}
